home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12489 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: maddawson@aol.com (MADDawson)
  3. Newsgroups: comp.lang.c
  4. Subject: FLOATING POINT PROBLEM
  5. Date: 1 Apr 1996 06:30:23 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4joeof$hoc@newsbf02.news.aol.com>
  9. Reply-To: maddawson@aol.com (MADDawson)
  10. NNTP-Posting-Host: newsbf02.mail.aol.com
  11.  
  12. I have been working on a Windows program.  The prog compiles correctly
  13. without any warnings or errors.  When I add something that tries to get a
  14. float value from a string, the program quits running.  It does this in and
  15. out of the IDE.
  16.  
  17. I have erased the project and copied a project from another program and I
  18. get the same results.  I have re-created the project from scratch and
  19. still no luck.
  20.  
  21. I have included every .h file I would think would have something to do
  22. with it.  I would REALLY appreciate some help with this as I have compiled
  23. a similar program correctly and have not had this problem before.  I would
  24. think it might be a compiler setting or something NOT in the program
  25. itself.
  26.  
  27. I have included the following lines.
  28.  
  29. float part_number;
  30. char buffer[100];
  31.  
  32. I get the value of the edit control using GetDlgItemText and put into
  33. buffer.  (This works as I have a MessageBox that shows the value.
  34.  
  35. Then I try:
  36.  
  37. part_number = atof(buffer);
  38.  
  39. This is where the prog stops.
  40.  
  41. I have also tried:
  42.  
  43. sscanf(buffer, "%f", &part_number);
  44.  
  45. It stops here, too.  (I have used this line in another prog and it works
  46. correctly.
  47.  
  48. Again, I would really appreciate any help I receive on this.
  49.  
  50. Thanks
  51. MAD
  52. maddawson@aol.com
  53. MADDawson@aol.com
  54. Project Engineer @ Kimball International
  55.